package com.whl.project.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.whl.project.model.UserInfoResult;
import com.whl.project.model.UserPasswordCheckParam;
import com.whl.project.service.UserService;

@RestController
@RequestMapping("/user")
public class UserController {

	@Autowired
	private UserService userService;

	@RequestMapping(value = "/load-by-account", method = RequestMethod.GET)
	public UserInfoResult loadUserByAccount(@RequestParam String account) throws Exception {
		UserInfoResult result = userService.loadByAccount(account);
		return result;
	}

	@RequestMapping(value = "/check-password", method = RequestMethod.POST)
	public Boolean checkPassword(@RequestBody UserPasswordCheckParam param) throws Exception {
		Boolean result = userService.checkPassword(param);
		return result;
	}

}
